home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C++ / Snippets / QD3D Juggler / Juggler Sources / CQD3DPane.h < prev    next >
Encoding:
Text File  |  1995-12-27  |  2.0 KB  |  69 lines  |  [TEXT/CWIE]

  1. //
  2. //    CQD3DPane.h
  3. //
  4. //    class CQD3DPane [abstract]
  5. //    A Pane for rendering a QuickDraw 3D view.
  6. //
  7. //    by James Jennings
  8. //    Started November 21, 1995
  9. //    Made abstract November 22.
  10. //
  11. //    Note: Be sure to turn off "Erase on Update" in the containing window
  12. //        or else you'll get lots of flickering. (Assuming you use updates
  13. //        for all of you're drawing.)
  14. //
  15.  
  16. #pragma once
  17.  
  18. #include <LPane.h>
  19. #include <QD3DView.h>
  20. #include <QD3DShader.h>
  21.  
  22. class CQD3DPane : public LPane {
  23. public:
  24.     enum { class_ID = 'Q3pn' };
  25.     // This is an abstract class: we can't create it directly from a stream.
  26. //    static CQD3DPane*    CreateQD3DPaneStream(LStream *inStream);
  27.     
  28.                     CQD3DPane();
  29.                     CQD3DPane(const CQD3DPane &inOriginal);        
  30.                     CQD3DPane(LStream *inStream);
  31.     
  32.     virtual            ~CQD3DPane();
  33.  
  34.     virtual void    FinishCreateSelf();
  35. protected:
  36.     // overridable functions for FinishCreate();
  37.     virtual void    MakeView();
  38.     virtual void    MakeCamera() = 0;    // must override
  39.     virtual void    MakeLightGroup() {}    // optional
  40.     virtual void    MakeDrawContext();    // standard is ok
  41.     virtual void    MakeRenderer();        // standard is ok
  42.     
  43.     virtual void    MakeModel() = 0;    // must override
  44.     
  45.     // Style accessors, called by FinishCreate()
  46.     virtual TQ3InterpolationStyle GetInterpolationStyle() 
  47.                         { return kQ3InterpolationStyleNone; }
  48.     virtual TQ3BackfacingStyle GetBackfacingStyle() 
  49.                         { return kQ3BackfacingStyleBoth; }
  50.     virtual TQ3FillStyle GetFillStyle() 
  51.                         { return kQ3FillStyleFilled; }
  52.     // called by MakeDrawContext()
  53.     virtual void        GetClearImageColor(TQ3ColorARGB *color)
  54.                         { ::Q3ColorARGB_Set(color, 1.0, 0.2, 0.2, 0.2); }
  55.     
  56.     // Rendering
  57.     virtual void        DrawSelf();
  58. protected:
  59.     virtual TQ3Status    SubmitScene();
  60. protected:
  61.     TQ3ViewObject    mView ;                    // the view for the scene
  62.     TQ3GroupObject    mModel ;                // object in the scene being modelled
  63.     TQ3StyleObject    mInterpolation ;        // interpolation style used when rendering
  64.     TQ3StyleObject    mBackFacing ;            // whether to draw shapes that face away from the camera
  65.     TQ3StyleObject    mFillStyle ;            // whether drawn as solid filled object or decomposed to components
  66.     
  67. };
  68.  
  69.